<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActiveScaffold::Bridge</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActiveScaffold::Bridge</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/plugins/active_scaffold/lib/bridges/bridge_rb.html">
                vendor/plugins/active_scaffold/lib/bridges/bridge.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000460">install</a>&nbsp;&nbsp;
      <a href="#M000461">install?</a>&nbsp;&nbsp;
      <a href="#M000459">new</a>&nbsp;&nbsp;
      <a href="#M000462">run</a>&nbsp;&nbsp;
      <a href="#M000463">run_all</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">name</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000459" class="method-detail">
        <a name="M000459"></a>

        <div class="method-heading">
          <a href="#M000459" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(name, &amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000459-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000459-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/bridges/bridge.rb, line 12</span>
12:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">name</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
13:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">name</span> = <span class="ruby-identifier">name</span>
14:       <span class="ruby-ivar">@install</span> = <span class="ruby-keyword kw">nil</span>
15:       <span class="ruby-comment cmt"># by convention and default, use the bridge name as the required constant for installation</span>
16:       <span class="ruby-ivar">@install_if</span> = <span class="ruby-identifier">lambda</span> { <span class="ruby-constant">Object</span>.<span class="ruby-identifier">const_defined?</span>(<span class="ruby-identifier">name</span>) }
17:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
18:       
19:       <span class="ruby-constant">ActiveScaffold</span><span class="ruby-operator">::</span><span class="ruby-constant">Bridge</span>.<span class="ruby-identifier">bridges</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>
20:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000463" class="method-detail">
        <a name="M000463"></a>

        <div class="method-heading">
          <a href="#M000463" class="method-signature">
          <span class="method-name">run_all</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000463-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000463-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/bridges/bridge.rb, line 38</span>
38:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">run_all</span>
39:       <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bridges_run</span>
40:       <span class="ruby-constant">ActiveScaffold</span><span class="ruby-operator">::</span><span class="ruby-constant">Bridge</span>.<span class="ruby-identifier">bridges</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">bridge</span><span class="ruby-operator">|</span>
41:         <span class="ruby-identifier">bridge</span>.<span class="ruby-identifier">run</span>
42:       }
43:       
44:       
45:       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bridges_run</span>=<span class="ruby-keyword kw">true</span>
46:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000460" class="method-detail">
        <a name="M000460"></a>

        <div class="method-heading">
          <a href="#M000460" class="method-signature">
          <span class="method-name">install</span><span class="method-args">(&amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Set the <a href="Bridge.html#M000460">install</a> block
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000460-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000460-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/bridges/bridge.rb, line 23</span>
23:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">install</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
24:       <span class="ruby-ivar">@install</span> = <span class="ruby-identifier">block</span>
25:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000461" class="method-detail">
        <a name="M000461"></a>

        <div class="method-heading">
          <a href="#M000461" class="method-signature">
          <span class="method-name">install?</span><span class="method-args">(&amp;block)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Set the install_if block (to check to see whether or not to <a
href="Bridge.html#M000460">install</a> the block)
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000461-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000461-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/bridges/bridge.rb, line 28</span>
28:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">install?</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
29:       <span class="ruby-ivar">@install_if</span> = <span class="ruby-identifier">block</span>
30:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000462" class="method-detail">
        <a name="M000462"></a>

        <div class="method-heading">
          <a href="#M000462" class="method-signature">
          <span class="method-name">run</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000462-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000462-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/active_scaffold/lib/bridges/bridge.rb, line 33</span>
33:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
34:       <span class="ruby-identifier">raise</span>(<span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;install and install? not defined for bridge #{name}&quot;</span> ) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@install</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@install_if</span>
35:       <span class="ruby-ivar">@install</span>.<span class="ruby-identifier">call</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@install_if</span>.<span class="ruby-identifier">call</span>
36:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>